<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" href="../layui/css/layui.css">
<script src="../layui/layui.js"></script>
<script src="../static/js/utils.js"></script>

<script>

</script>
</head>
<body>
<script id="mytpl" type="text/html">
{{#  layui.each(d.data, function(index, item){ }}

  	<div class="layui-col-xs6 layui-col-sm3">
      <div class="list-detail">
        <div class="img"><img src="{{item.images}}"></div>
        <p class="title"><a href="detail.html">{{item.gname}}</a></p>
        <p><span class="price">￥{{item.price}}</span></p> 
      </div>
    </div>
{{#  }); }}
{{#  if(d.data.length === 0){ }}
    无数据
  {{#  } }} 
  </script>
  <div class="layui-row layui-col-space25">
    <div id="view"></div>
  </div>
<button id="refresh" class="layui-btn">刷新</button>



<script type="text/javascript">
layui.use(['jquery','laytpl'],function(){
	var laytpl = layui.laytpl;
	var $ = layui.jquery;
	//第三步：渲染模版
	var mydata = {"msg":"","code":0,"data":[{"gid":1,"gname":"小女孩画夹挂布","price":"18.9","quantity":80,"images":null,"gdesc":"北欧风格|材质：布","createTime":null,"modifyTime":{"dayOfMonth":11,"dayOfWeek":"SATURDAY","dayOfYear":193,"month":"JULY","year":2020,"monthValue":7,"hour":17,"minute":25,"nano":0,"second":50,"chronology":{"id":"ISO","calendarType":"iso8601"}},"deleted":null,"category":{"cid":1,"cname":"床品1","createTime":null,"modifyTime":null,"deleted":null}},{"gid":2,"gname":"北欧风布艺沙发","price":"1799","quantity":30,"images":null,"gdesc":"简约现代风格|支持拆洗|填充物：海绵","createTime":{"dayOfMonth":10,"dayOfWeek":"FRIDAY","dayOfYear":192,"month":"JULY","year":2020,"monthValue":7,"hour":0,"minute":0,"nano":0,"second":7,"chronology":{"id":"ISO","calendarType":"iso8601"}},"modifyTime":{"dayOfMonth":10,"dayOfWeek":"FRIDAY","dayOfYear":192,"month":"JULY","year":2020,"monthValue":7,"hour":0,"minute":0,"nano":0,"second":34,"chronology":{"id":"ISO","calendarType":"iso8601"}},"deleted":null,"category":{"cid":3,"cname":"布艺","createTime":null,"modifyTime":null,"deleted":null}},{"gid":3,"gname":"圣尼卡港式轻奢布艺软包沙发","price":"17432","quantity":10,"images":null,"gdesc":"轻奢风格|不支持拆洗|填充物：羽绒","createTime":{"dayOfMonth":10,"dayOfWeek":"FRIDAY","dayOfYear":192,"month":"JULY","year":2020,"monthValue":7,"hour":0,"minute":1,"nano":0,"second":34,"chronology":{"id":"ISO","calendarType":"iso8601"}},"modifyTime":{"dayOfMonth":10,"dayOfWeek":"FRIDAY","dayOfYear":192,"month":"JULY","year":2020,"monthValue":7,"hour":0,"minute":1,"nano":0,"second":34,"chronology":{"id":"ISO","calendarType":"iso8601"}},"deleted":null,"category":{"cid":3,"cname":"布艺","createTime":null,"modifyTime":null,"deleted":null}},{"gid":4,"gname":"LED吸顶灯","price":"9.9","quantity":60,"images":null,"gdesc":"简约现代风格|亚克力吸顶灯","createTime":{"dayOfMonth":10,"dayOfWeek":"FRIDAY","dayOfYear":192,"month":"JULY","year":2020,"monthValue":7,"hour":0,"minute":4,"nano":0,"second":5,"chronology":{"id":"ISO","calendarType":"iso8601"}},"modifyTime":{"dayOfMonth":10,"dayOfWeek":"FRIDAY","dayOfYear":192,"month":"JULY","year":2020,"monthValue":7,"hour":0,"minute":4,"nano":0,"second":5,"chronology":{"id":"ISO","calendarType":"iso8601"}},"deleted":null,"category":{"cid":2,"cname":"灯具23","createTime":null,"modifyTime":null,"deleted":null}},{"gid":5,"gname":"马卡龙圆形灯饰","price":"23.9","quantity":40,"images":null,"gdesc":"北欧风格|木艺吸顶灯","createTime":{"dayOfMonth":10,"dayOfWeek":"FRIDAY","dayOfYear":192,"month":"JULY","year":2020,"monthValue":7,"hour":0,"minute":5,"nano":0,"second":8,"chronology":{"id":"ISO","calendarType":"iso8601"}},"modifyTime":{"dayOfMonth":10,"dayOfWeek":"FRIDAY","dayOfYear":192,"month":"JULY","year":2020,"monthValue":7,"hour":0,"minute":5,"nano":0,"second":8,"chronology":{"id":"ISO","calendarType":"iso8601"}},"deleted":null,"category":{"cid":2,"cname":"灯具23","createTime":null,"modifyTime":null,"deleted":null}},{"gid":6,"gname":"水洗棉夏季卡通四件套","price":"39","quantity":100,"images":null,"gdesc":"材质：涤纶|卡通风|磨毛","createTime":{"dayOfMonth":10,"dayOfWeek":"FRIDAY","dayOfYear":192,"month":"JULY","year":2020,"monthValue":7,"hour":0,"minute":6,"nano":0,"second":50,"chronology":{"id":"ISO","calendarType":"iso8601"}},"modifyTime":{"dayOfMonth":10,"dayOfWeek":"FRIDAY","dayOfYear":192,"month":"JULY","year":2020,"monthValue":7,"hour":0,"minute":6,"nano":0,"second":50,"chronology":{"id":"ISO","calendarType":"iso8601"}},"deleted":null,"category":{"cid":1,"cname":"床品1","createTime":null,"modifyTime":null,"deleted":null}},{"gid":7,"gname":"无印风日式水洗棉床单三件套","price":"39","quantity":120,"images":null,"gdesc":"材质：涤纶|日式","createTime":{"dayOfMonth":10,"dayOfWeek":"FRIDAY","dayOfYear":192,"month":"JULY","year":2020,"monthValue":7,"hour":0,"minute":8,"nano":0,"second":53,"chronology":{"id":"ISO","calendarType":"iso8601"}},"modifyTime":{"dayOfMonth":10,"dayOfWeek":"FRIDAY","dayOfYear":192,"month":"JULY","year":2020,"monthValue":7,"hour":0,"minute":8,"nano":0,"second":53,"chronology":{"id":"ISO","calendarType":"iso8601"}},"deleted":null,"category":{"cid":1,"cname":"床品1","createTime":null,"modifyTime":null,"deleted":null}},{"gid":8,"gname":"家用无纺布收纳箱","price":"4.9","quantity":300,"images":null,"gdesc":"材质：无纺布","createTime":{"dayOfMonth":10,"dayOfWeek":"FRIDAY","dayOfYear":192,"month":"JULY","year":2020,"monthValue":7,"hour":0,"minute":10,"nano":0,"second":16,"chronology":{"id":"ISO","calendarType":"iso8601"}},"modifyTime":{"dayOfMonth":10,"dayOfWeek":"FRIDAY","dayOfYear":192,"month":"JULY","year":2020,"monthValue":7,"hour":0,"minute":10,"nano":0,"second":16,"chronology":{"id":"ISO","calendarType":"iso8601"}},"deleted":null,"category":{"cid":4,"cname":"收纳","createTime":null,"modifyTime":null,"deleted":null}},{"gid":9,"gname":"办公桌面收纳箱","price":"10.9","quantity":200,"images":null,"gdesc":"材质：塑料|日式风格","createTime":{"dayOfMonth":10,"dayOfWeek":"FRIDAY","dayOfYear":192,"month":"JULY","year":2020,"monthValue":7,"hour":0,"minute":11,"nano":0,"second":26,"chronology":{"id":"ISO","calendarType":"iso8601"}},"modifyTime":{"dayOfMonth":10,"dayOfWeek":"FRIDAY","dayOfYear":192,"month":"JULY","year":2020,"monthValue":7,"hour":0,"minute":11,"nano":0,"second":45,"chronology":{"id":"ISO","calendarType":"iso8601"}},"deleted":null,"category":{"cid":4,"cname":"收纳","createTime":null,"modifyTime":null,"deleted":null}},{"gid":10,"gname":"康巴斯挂钟","price":"38.5","quantity":70,"images":null,"gdesc":"木|简约现代|三唯一居","createTime":{"dayOfMonth":10,"dayOfWeek":"FRIDAY","dayOfYear":192,"month":"JULY","year":2020,"monthValue":7,"hour":0,"minute":14,"nano":0,"second":26,"chronology":{"id":"ISO","calendarType":"iso8601"}},"modifyTime":{"dayOfMonth":10,"dayOfWeek":"FRIDAY","dayOfYear":192,"month":"JULY","year":2020,"monthValue":7,"hour":0,"minute":14,"nano":0,"second":26,"chronology":{"id":"ISO","calendarType":"iso8601"}},"deleted":null,"category":{"cid":5,"cname":"小家具","createTime":null,"modifyTime":null,"deleted":null}}],"count":11}
	
	console.log(mydata);
	
	$.ajax({
		url : '../goods/listPage?page=1&limit=10',
		type : "post",
		dataType : "json",
		success : function(data) {
			renderGoods($,laytpl,data,'#mytpl','view');
		}
	})
	
	
	
	
})
</script>



</body>
</html>